package sv.edu.edutec.fotos.model;

// Generated 12-11-2013 10:21:09 AM by Hibernate Tools 3.4.0.CR1

import static javax.persistence.GenerationType.IDENTITY;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

/**
 * TblPhoto generated by hbm2java
 */
@Entity
@Table(name = "tbl_photo")
public class TblPhoto implements java.io.Serializable {

	private int photoId;
	private String title;
	private byte[] photoFile;
	private String description;
	private Date createdDate;
	private String owner;
	private Set<TblComment> tblComments = new HashSet(0);
	
	public TblPhoto() {
	}

	public TblPhoto(int photoId) {
		this.photoId = photoId;
	}

	public TblPhoto(int photoId, String title, byte[] photoFile,
			String description, Date createdDate, String owner, Set tblComments) {
		this.photoId = photoId;
		this.title = title;
		this.photoFile = photoFile;
		this.description = description;
		this.createdDate = createdDate;
		this.owner = owner;
		this.tblComments = tblComments;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "photo_id", unique = true, nullable = false)
	public int getPhotoId() {
		return this.photoId;
	}

	public void setPhotoId(int photoId) {
		this.photoId = photoId;
	}

	@Column(name = "title")
	public String getTitle() {
		return this.title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	@Column(name = "photo_file")
	public byte[] getPhotoFile() {
		return this.photoFile;
	}

	public void setPhotoFile(byte[] photoFile) {
		this.photoFile = photoFile;
	}

	@Column(name = "description")
	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "created_date", length = 19)
	public Date getCreatedDate() {
		return this.createdDate;
	}

	public void setCreatedDate(Date createdDate) {
		this.createdDate = createdDate;
	}

	@Column(name = "owner")
	public String getOwner() {
		return this.owner;
	}

	public void setOwner(String owner) {
		this.owner = owner;
	}

	@OneToMany(fetch = FetchType.EAGER, mappedBy = "tblPhoto")
	public Set<TblComment> getTblComments() {
		return this.tblComments;
	}

	public void setTblComments(Set<TblComment> tblComments) {
		this.tblComments = tblComments;
	}
	
		
}
